import "./index.less";
import { FC } from "react";
import { Image } from "antd";
import PropTypes from "prop-types";

interface ThumbUrlProps {
	fileUrl?: string;
	fileName?: string;
}

const ThumbUrl: FC<ThumbUrlProps> = ({ fileUrl }) => {
	return <span className="thumb">{fileUrl && <Image src={fileUrl} width={104} preview={{ mask: false }} />}</span>;
};

// 使用 PropTypes 定义默认值
ThumbUrl.propTypes = {
	fileUrl: PropTypes.string,
	fileName: PropTypes.string
};

// 设置默认属性
ThumbUrl.defaultProps = {
	fileUrl: "",
	fileName: ""
};

export default ThumbUrl;
